#include<stdio.h>
int main(){

	int arr[10];
	for (int i=0;i<10;i++){
		scanf("%d",&arr[i]);
	}
	
	for (int j=0;j<10;j++){
		j != 9 ? printf("%d,",arr[j]) : printf("%d",arr[j]);
	}
	printf("\n");
	for (int k=9;k>=0;k--){
		k !=0 ? printf("%d,",arr[k]) : printf("%d",arr[k]);
	}

	return 0;
}
